'''oto/rules.py

This module contains the Rules class.
'''

__authors__ = ['Ryan Rousseau <ryan.rousseau@gmail.com>']
__license__ = '''Oranges to Oranges
Copyright (C) 2006  Ryan Rousseau

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
'''

__all__ = ['Rules']

class Rules(object):
    def __init__(self, cards_per_hand=7, trophy_cards_per_round=1,
                 draw_hand_cards_from='noun', draw_trophy_cards_from='adj'):
        self.cards_per_hand = cards_per_hand
        self.trophy_cards_per_round = trophy_cards_per_round
        self.draw_hand_cards_from = draw_hand_cards_from
        self.draw_trophy_cards_from = draw_trophy_cards_from

    def draw_hand_card(self, deck):
        if 'noun' == draw_hand_cards_from:
            return deck.draw_noun()
        else:
            return deck.draw_adj()

    def draw_trophy_card(self, deck):
        if 'adj' == draw_trophy_cards_from:
            return deck.draw_adj()
        else:
            return deck.draw_noun()
